package com.hzlx.consumption.feign.fallback;

import com.hzlx.MesMaterialBatchesDto;
import com.hzlx.consumption.feign.MaterialBatchesService;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MaterialBatchesServiceFallbackFactory implements FallbackFactory<MaterialBatchesService> {
    @Override
    public MaterialBatchesService create(Throwable cause) {
                return new MaterialBatchesService() {
                    @Override
                    public AjaxResult editDtos(MesMaterialBatchesDto mesMaterialBatchesDto) {
                        return AjaxResult.error("库存查询失败：" + cause.getMessage());
                    }

                };
        }
    }

